From 6c4ced0f79f801d85da5e4973ae4154f01b04dba Mon Sep 17 00:00:00 2001 From: Sebastien Castiel Date: Wed, 6 Dec 2023 12:22:24 -0500 Subject: Loading screens & layouts --- src/app/groups/[groupId]/layout.tsx | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/app/groups/[groupId]/layout.tsx (limited to 'src/app/groups/[groupId]/layout.tsx') diff --git a/src/app/groups/[groupId]/layout.tsx b/src/app/groups/[groupId]/layout.tsx new file mode 100644 index 0000000..f8030c6 --- /dev/null +++ b/src/app/groups/[groupId]/layout.tsx @@ -0,0 +1,37 @@ +import { Button } from '@/components/ui/button' +import { getGroup } from '@/lib/api' +import { ChevronLeft, Edit } from 'lucide-react' +import Link from 'next/link' +import { notFound } from 'next/navigation' +import { PropsWithChildren } from 'react' + +export default async function GroupLayout({ + children, + params: { groupId }, +}: PropsWithChildren<{ + params: { groupId: string } +}>) { + const group = await getGroup(groupId) + if (!group) notFound() + + return ( +
+
+ + +
+ +

{group.name}

+ + {children} +
+ ) +} -- cgit v1.3